<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <#if parent??>
        <parent>
            <groupId>${parent.groupId}</groupId>
            <artifactId>${parent.artifactId}</artifactId>
            <#if imRootPom>
                <version>${parent.version}</version>
            <#else>
                <version>${r"${revision}"}</version>
            </#if>
        </parent>
    </#if>

    <#if imRootPom>
        <groupId>${groupId}</groupId>
    </#if>
    <artifactId>${artifactId}</artifactId>
    <#if imRootPom>
        <version>${r"${revision}"}</version>
    </#if>
    <name>${artifactId}</name>
    <#if imRootPom>
        <#if imStarterPom>
            <packaging>jar</packaging>
        <#else >
            <packaging>pom</packaging>
        </#if>
    </#if>
    <#if imRootPom>
        <description>${description}</description>
    </#if>

    <#if properties??>
        <properties>
        <#list properties? keys as key>
            <${key}>${properties[key]}</${key}>
        </#list>
        </properties>
    </#if>

    <#if modules?? && (modules?size > 0) >
        <modules>
            <#list modules as m>
                <module>${m}</module>
            </#list>
        </modules>
    </#if>

    <#if imRootPom>
        <dependencyManagement>
            <dependencies>
                <#if modules?? && (modules?size > 0) >
                    <#list modules as m>
                        <dependency>
                            <groupId>${groupId}</groupId>
                            <artifactId>${m}</artifactId>
                            <#if imRootPom>
                                <version>${r"${revision}"}</version>
                            </#if>
                        </dependency>
                    </#list>
                </#if>
                <#if dependencyManagement??  && (dependencyManagement?size > 0)>
                    <#list dependencyManagement as d>
                        <dependency>
                            <groupId>${d.groupId}</groupId>
                            <artifactId>${d.artifactId}</artifactId>
                            <#if d.version??>
                                <version>${d.version}</version>
                            </#if>
                            <#if d.optional??>
                                <optional>${d.optional}</optional>
                            </#if>
                            <#if d.scope??>
                                <scope>${d.scope}</scope>
                            </#if>
                            <#if d.exclusions?? && (d.exclusions?size > 0)>
                                <exclusions>
                                    <#list d.exclusions as exclusion>
                                        <exclusion>
                                            <groupId>${exclusion.groupId}</groupId>
                                            <artifactId>${exclusion.artifactId}</artifactId>
                                        </exclusion>
                                    </#list>
                                </exclusions>
                            </#if>
                        </dependency>
                    </#list>
                </#if>
            </dependencies>
        </dependencyManagement>
    </#if>
    <dependencies>
        <#if dependencyModules?? && (dependencyModules?size > 0) >
            <#list dependencyModules as m>
                <dependency>
                    <groupId>${groupId}</groupId>
                    <artifactId>${m}</artifactId>
                    <#if imRootPom>
                        <version>${r"${revision}"}</version>
                    </#if>
                </dependency>
            </#list>
        </#if>
        <#if dependencies?? && (dependencies?size > 0)>
            <#list dependencies as d>
                <dependency>
                    <groupId>${d.groupId}</groupId>
                    <artifactId>${d.artifactId}</artifactId>
                    <#if d.version??>
                        <version>${d.version}</version>
                    </#if>
                    <#if d.optional??>
                        <optional>${d.optional}</optional>
                    </#if>
                    <#if d.scope??>
                        <scope>${d.scope}</scope>
                    </#if>
                    <#if d.exclusions?? && (d.exclusions?size > 0)>
                        <exclusions>
                            <#list d.exclusions as exclusion>
                                <exclusion>
                                    <groupId>${exclusion.groupId}</groupId>
                                    <artifactId>${exclusion.artifactId}</artifactId>
                                </exclusion>
                            </#list>
                        </exclusions>
                    </#if>
                </dependency>
            </#list>
        </#if>
    </dependencies>
    <build>
        <#if imRootPom>
            <pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>3.8.1</version>
                        <configuration>
                            <showWarnings>true</showWarnings>
                            <showDeprecation>false</showDeprecation>
                            <source>${r'${maven.compiler.source}'}</source>
                            <target>${r'${maven.compiler.target}'}</target>
                            <encoding>${r'${project.build.sourceEncoding}'}</encoding>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.2.1</version>
                        <executions>
                            <execution>
                            <id>attach-sources</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.1.1</version>
                    <configuration>
                        <additionalOptions>
                            <additionalOption>-Xdoclint:none</additionalOption>
                        </additionalOptions>
                    </configuration>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                </plugins>
            </pluginManagement>
        </#if>
        <#if imStarterPom>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <#if mainClass??>
                        <configuration>
                            <mainClass>${mainClass}</mainClass>
                        </configuration>
                    </#if>
                    <executions>
                        <execution>
                            <goals>
                                <goal>repackage</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </#if>
    </build>
</project>